from manim import *

class CustomCurve(VMobject):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        # 定义自定义曲线的控制点
        points = [
            [-35, 0, 0],
            [-25,-5,0],
            [-20,-15,0],
            [-19, -20, 0]
        ]
        self.set_points_smoothly(points)



class math1(MovingCameraScene):
    def construct(self):
        self.camera.background_color = BLACK  # 设置背景颜色
        self.camera.frame_width = 100  # 设置边框宽度
        self.camera.frame_height = 60  # 设置边框高度
        self.camera.pixel_height = 1080  # 设置像素高度
        self.camera.pixel_width = 1920  # 设置像素宽度
        self.camera.center = ORIGIN  # 设置中心点位置
        self.camera.scale_factor = 1.0  # 设置缩放因子
        #设置横线
        for i in range(6*2+1):       
            dot1=Dot([-50,5*(i-6),0]).set_opacity(0.5)
            dot2=Dot([50,5*(i-6),0]).set_opacity(0.5)
            if i==6:
                line1=Line(dot1,dot2).set_color(WHITE).set_opacity(0.5)
                
            else:
                line1=Line(dot1,dot2).set_color(WHITE).set_opacity(0.5)
               
            self.add(dot1,dot2,line1)
        #设置竖线
        for i in range(10*2+1):        
            dot3=Dot([(i-10)*5,-30,0]).set_opacity(0.5)
            dot4=Dot([(i-10)*5,30,0]).set_opacity(0.5)
            if i==10:
                line2=Line(dot3,dot4).set_color(WHITE).set_opacity(0.5)
                
            else:
                line2=Line(dot3,dot4).set_color(WHITE).set_opacity(0.5)
            self.add(dot3,dot4,line2)
        #设置三个点
        dot1 = Dot(radius=1, color=RED)  
        dot1.move_to([-47.5,27.5,0]) 
        dot2 = Dot(radius=1, color=YELLOW)  
        dot2.move_to([-42.5,27.5,0])  
        dot3 = Dot(radius=1, color=GREEN)  
        dot3.move_to([-37.5,27.5,0])
         #镜头跟进效果 
        self.camera.frame.save_state()
         #题目出现
        text = Tex(r"\text{设函数}$f\left( x\right) $\text{具有二阶导数,}$f\left( 0\right)  >0,f'\left( 0\right)  <0,$\text{当}$x\geq 0$\text{时,}$f''\left( x\right)  <0,$"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0)
        text100 = Tex(
                  r"\text{则下列说法中,正确的是}"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-24.5,-3,0])
        text1 = Tex(
                  r"$(A)f\left( -f\left( 0\right) f'\left( 0\right) \right)  >0$"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-22,-7,0])
        text2 = Tex(
                    r"$(B)f\left( \dfrac{-f\left( 0\right) }{f'\left( 0\right) }\right)  >0$"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([22,-7,0])
        text3 = Tex(
                   r"$(C)f\left( x\right) $\text{在}$[  0,+\infty ) $\text{上只有一个零点}"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-22,-14,0])
        text4 = Tex(
                    r"$(D)f\left( x\right) $\text{在}$[  0,+\infty ) $\text{上没有零点}"
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([22,-14,0])

        self.play(Write(text),self.camera.frame.animate.scale(0.8),Write(text1),Write(text2),Write(text3),Write(text4),Write(text100))
        self.wait(0.1)
        #镜头拉回
          #分析文本
        #text100=MarkupText("<b><i>分析/解：</i></b>",color=PINK).scale(5.0).move_to([-38,12.5,0])
        self.play(Restore(self.camera.frame))
        self.play(FadeIn(dot1),run_time=0.1)
        self.play(FadeIn(dot2),run_time=0.1)
        self.play(FadeIn(dot3),run_time=0.1)
        #题目向上移动
        self.play(text.animate().move_to([0,20,0]),text1.animate().move_to([-22,13,0]) ,text2.animate().move_to([22,13,0]),text3.animate().move_to([-22,6,0]),text4.animate().move_to([22,6,0]),text100.animate().move_to([-24.5,17,0]) )


        #镜头拉近
        self.play(self.camera.frame.animate.scale(1).move_to([30,15,0]))
        #箭头+框框
         #箭头引出
        arrow101 = Arrow(start=[40,27,0],end=[35,24,0], color=RED
                       , stroke_width=20, tip_length=1)
        self.play(Create(arrow101))
        #文本
        long_text=("特征识别:\n"
                     "二阶导数信息")
        text101 = Text(long_text,color=YELLOW,
                   font_size=200).move_to([50,27,0])
        #框框标
        rectangle=Rectangle(color=BLUE,fill_opacity=0.0,width=13,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle.move_to([32, 20, 0])
        self.play(Create(rectangle),Create(text101))
        self.wait(0.1)
        #镜头拉回
        self.play(Restore(self.camera.frame))
        #主题展开：
        #1文本
        text5 = Tex(
                    r"$f''\left( x\right)  >0$\text{或}$ <0$",color=PURPLE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-30,-10,0])
        #2框框标
        rectangle1=Rectangle(color=BLUE,fill_opacity=0.0,width=20,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle1.move_to([-30,-10,0])
        #3箭头
        arrow1 = Arrow(start=[-19,-7,0],end=[-15,-2.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow2 = Arrow(start=[-19,-10,0],end=[-15,-10,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow3 = Arrow(start=[-19,-12,0],end=[-15,-17.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        #4文本
        text6 = Tex(
                    r"\text{泰勒不等式(单向)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-4,-2.5,0])
        text7 = Tex(
                    r"\text{几何意义}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-10,-10,0])
        text8 = Tex(
                    r"\text{反证法}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-10,-17.5,0])
        #5箭头
        arrow4 = Arrow(start=[8,-1,0],end=[13,0,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow5 = Arrow(start=[8,-4,0],end=[13,-5,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow6 = Arrow(start=[-4,-9,0],end=[1,-8,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow7 = Arrow(start=[-4,-11,0],end=[1,-12,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow8 = Arrow(start=[-4,-17.5,0],end=[1,-17.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        text9 = Tex(
                    r"$f'\left( x_{0}\right) =0$\text{(极值)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([24,0,0])
        text10 = Tex(
                    r"$f'\left( x_{0}\right) \neq 0$",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([19,-5,0])
        text11 = Tex(
                    r"\text{无初始信息}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([7,-8,0])
        text12 = Tex(
                    r"\text{有初始信息(画草图/琴生不等式)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([20,-12,0])
        text13 = Tex(
                    r"\text{零点唯一与不唯一等问题}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([16,-17.5,0])
        self.play(Write(text5),Create(rectangle1))
        self.play(Create(arrow1),Create(arrow2),Create(arrow3))
        self.play(Create(text6),Create(text7),Create(text8))
        self.play(Create(arrow4),Create(arrow5),Create(arrow6),Create(arrow7),Create(arrow8))
        self.play(Create(text9),Create(text10),Create(text11),Create(text12),Create(text13))
        #
        #半透明矩阵扩展
        rectangle2=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([2,20,0])
        self.play(
            rectangle2.animate().stretch(24.0,dim=0)
        )
        self.wait(0.1)
        #框框标记
        rectangle3=Rectangle(color=BLUE,fill_opacity=0.0,width=21,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle3.move_to([-4,-2.5,0])
        rectangle4=Rectangle(color=BLUE,fill_opacity=0.0,width=12,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle4.move_to([19,-5,0])
        self.play( 
            Create(rectangle3),Create(rectangle4)
        )
        self.wait(0.1)
        #清除部分元素
        self.play(Uncreate(text13),Uncreate(text12),Uncreate(text11),Uncreate(text10),Uncreate(text9)
                  ,Uncreate(text8),Uncreate(text7),Uncreate(text6),Uncreate(text5)
                  ,Uncreate(arrow1),Uncreate(arrow2),Uncreate(arrow3),Uncreate(arrow4)
                  ,Uncreate(arrow5),Uncreate(arrow6),Uncreate(arrow7),Uncreate(arrow8)
                  ,FadeOut(rectangle4),FadeOut(rectangle3),FadeOut(rectangle1))
        #文本
        text = Tex(
                    r"\text{泰勒等式}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-30,-5,0])
        self.play(Write(text))
        text3 = Tex(
                    r"$f\left( x\right) =f\left( 0\right) +f'\left( 0\right) x+\dfrac{f''\left( \xi \right) }{2}x^{2}$",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        self.play(Write(text3))
        #箭头+文本
        arrow = Arrow(start=[-20,-5,0],end=[20,-5,0],color=RED
                       , stroke_width=20, tip_length=1)
        text1 = Tex(
                    r"$f''\left( x\right)  <0$",color=YELLOW_D
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,0,0])
        self.play(GrowArrow(arrow),Write(text1))
        #文本
        text2 = Tex(
                    r"\text{泰勒不等式}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([30,-5,0])
        self.play(Write(text2))
        text4 = Tex(
                    r"$f\left( x\right) \leq f\left( 0\right) +f'\left( 0\right) x$",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        #文本丝滑变化
        self.play(
            ReplacementTransform(text3,text4)
        )
        self.wait(0.5)
        #箭头标记

        arrow1 = Arrow(start=[-12,-15,0],end=[-7,-12,0], color=RED
                       , stroke_width=20, tip_length=1)
        self.play(Create(arrow1))
        self.play(FadeOut(arrow1))
        #A选项
        rectangle3=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([-22,13,0])
        self.play(
            rectangle3.animate().stretch(26.0,dim=0)
        )
        self.wait(0.1)
        #箭头标记

        arrow1 = Arrow(start=[-12,-15,0],end=[-9,-12,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow2 = Arrow(start=[15,-15,0],end=[12,-12,0], color=RED
                       , stroke_width=20, tip_length=1)
        self.play(Create(arrow1),Create(arrow2))
        self.play(FadeOut(arrow1),FadeOut(arrow2))
        #文本丝滑变化
        text5 = Tex(
                    r"$f\left( -f\left( 0\right) f'\left( 0\right) \right) <f\left( 0\right) -f\left( 0\right) \left( f'\left( 0\right) \right) ^{2} $",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        text6 = Tex(
                    r"$f\left( -f\left( 0\right) f'\left( 0\right) \right) < f\left( 0\right) \left[ 1-\left( f'\left( 0\right) \right) ^{2}\right] $",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])

        self.play(
            ReplacementTransform(text4,text5)
        )
        self.wait(0.5)
        self.play(
            ReplacementTransform(text5,text6)
        )
        self.wait(0.5)
        #箭头指示
        arrow2 = Arrow(start=[-5,-15,0],end=[-2,-13,0], color=RED
                       , stroke_width=20, tip_length=1)
        self.play(Create(arrow2))
        self.play(FadeOut(arrow2))
        #下划线
        dot1=Dot([6,-13,0])
        dot2=Dot([21,-13,0])
        line=Line(dot1,dot2).set_color(PURPLE)
        line.set_stroke(width=30)  # 设置宽度为 30
        self.play(Create(line))
        self.play(FadeOut(line))
        text40 = Tex(
                    r"$f\left( x\right) \leq f\left( 0\right) +f'\left( 0\right) x$",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        self.play(
            ReplacementTransform(text6,text40)
        )

        self.wait(0.5)
        #选项B
        self.play(FadeOut(rectangle3))
        rectangle4=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([22.5,13,0])
        self.play(
            rectangle4.animate().stretch(26.0,dim=0)
        )
        self.wait(0.1)
        #文本丝滑变化
        text70 = Tex(
                    r"$f\left( \dfrac{-f\left( 0\right) }{f'\left( 0\right) }\right) <f\left( 0\right) -f\left( 0\right) \cdot \dfrac{f\left( 0\right) }{f'\left( 0\right) } $",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        text80 = Tex(
                    r"$f\left( \dfrac{-f\left( 0\right) }{f'\left( 0\right) }\right) <0$",color=BLUE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([0,-10,0])
        self.play(
            ReplacementTransform(text40,text70)
        )
        self.wait(0.5)
        self.play(
            ReplacementTransform(text70,text80)
        )
        self.wait(0.1)
        #清除部分
        self.play(FadeOut(text),FadeOut(text1),FadeOut(text2)
                  ,FadeOut(arrow),FadeOut(rectangle4))
        #移动文本
        self.play(text80.animate().move_to([25,-5,0])) 
        #CD选项
        rectangle5=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([-22,6,0])
        rectangle6=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([22,6,0])
        self.play(
            rectangle5.animate().stretch(42.0,dim=0),
            rectangle6.animate().stretch(36.0,dim=0)

        )
        self.wait(0.1)

        #坐标轴
         #画坐标轴

        axes = Axes(
            x_range=[-PI, PI, PI],  # 设置 x 轴范围，从 -3π 到 3π，步长为 π/2
            y_range=[-1.5, 1.5, 0.5],     # 设置 y 轴范围，从 -1.5 到 1.5，步长为 0.5
            axis_config={"color": WHITE,"stroke_width": 30},  # 设置坐标轴的颜色
            x_length=40,  # 控制 x 轴长度
            y_length=20 ,   # 控制 y 轴长度
        )
        axes.move_to([-25,-10,0])
        # 绘制 cos(x) 函数图像，负半轴部分为蓝色
        sin_graph_left = axes.plot(lambda x: np.sin(x), color=BLUE,stroke_width=30, x_range=[0, PI])

        # 添加坐标系和函数图像到场景中
        #self.add(axes, cos_graph_left, cos_graph_right)

        # 添加标题
        title = Text("f(x)",color=GREEN, font_size=240).next_to(axes, UP,buff=1)
        self.add(title)

        # 显示图像
        self.play(Create(axes),  Write(title))
        #框框闪动
        rectangle100=Rectangle(color=BLUE,fill_opacity=0.0,width=20,height=10
                            ,stroke_color=YELLOW,stroke_width=20)
        rectangle100.move_to([25,-5,0])
        self.play(Create(rectangle100))
        self.play(FadeOut(rectangle100))
         #三个点
        dot4 = Dot(radius=0.5, color=RED)  
        dot4.move_to([-25,-5,0]) 
        dot5 = Dot(radius=0.5, color=YELLOW)  
        dot5.move_to([-20,-15,0])  
        self.play(Create(dot4))
        self.play( Create(dot5))
        
        curve = CustomCurve(color=RED, stroke_width=20)
        
        # 添加到场景并播放动画
        self.play(Create(curve))
        self.wait()

        #清除
        self.play(Uncreate(dot4),Uncreate(dot5),FadeOut(curve)
                  ,Uncreate(text80),FadeOut(rectangle2),FadeOut(rectangle)
                  ,FadeOut(title),FadeOut(axes)
                  ,Uncreate(arrow101),Uncreate(text101))
        #框框标记

        #框框闪动
        rectangle200=Rectangle(color=BLUE,fill_opacity=0.0,width=11,height=5
                            ,stroke_color=YELLOW,stroke_width=20)
        rectangle200.move_to([-3,20,0])
        self.play(Create(rectangle200))
        #框框移动
        self.wait(0.5)
        self.play(rectangle200.animate().move_to([7.5,20,0]))
        self.wait(0.5)
        self.play(rectangle200.animate().move_to([32, 20, 0]))
        self.wait(0.5)
        #化趋势图
        self.play(Create(axes),  Write(title))
        self.play(rectangle200.animate().move_to([-3,20,0]))
        dot4 = Dot(radius=0.5, color=RED)  
        dot4.move_to([-25,-5,0]) 
        self.play(Create(dot4))
        self.play(rectangle200.animate().move_to([7.5,20,0]))
        self.wait(0.5)
        self.play(rectangle200.animate().move_to([32, 20, 0]))
        self.wait(0.5)
        # 添加到场景并播放动画
        self.play(Create(curve))
        #清空
        self.play(Uncreate(dot4),FadeOut(curve)
                  ,FadeOut(rectangle200),FadeOut(rectangle5),FadeOut(rectangle6)
                  ,FadeOut(title),FadeOut(axes)
                )

        #总结
        #箭头+框框
         #箭头引出
        arrow101 = Arrow(start=[40,27,0],end=[35,24,0], color=RED
                       , stroke_width=20, tip_length=1)
        self.play(Create(arrow101))
        #文本
        long_text=("特征识别:\n"
                     "二阶导数信息")
        text101 = Text(long_text,color=YELLOW,
                   font_size=200).move_to([50,27,0])
        #框框标
        rectangle=Rectangle(color=BLUE,fill_opacity=0.0,width=13,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle.move_to([32, 20, 0])
        self.play(Create(rectangle),Create(text101))
        self.wait(0.1)
        #镜头拉回
        self.play(Restore(self.camera.frame))
        #主题展开：
        #1文本
        text5 = Tex(
                    r"$f''\left( x\right)  >0$\text{或}$ <0$",color=PURPLE
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-30,-10,0])
        #2框框标
        rectangle1=Rectangle(color=BLUE,fill_opacity=0.0,width=20,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle1.move_to([-30,-10,0])
        #3箭头
        arrow1 = Arrow(start=[-19,-7,0],end=[-15,-2.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow2 = Arrow(start=[-19,-10,0],end=[-15,-10,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow3 = Arrow(start=[-19,-12,0],end=[-15,-17.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        #4文本
        text6 = Tex(
                    r"\text{泰勒不等式(单向)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-4,-2.5,0])
        text7 = Tex(
                    r"\text{几何意义}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-10,-10,0])
        text8 = Tex(
                    r"\text{反证法}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([-10,-17.5,0])
        #5箭头
        arrow4 = Arrow(start=[8,-1,0],end=[13,0,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow5 = Arrow(start=[8,-4,0],end=[13,-5,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow6 = Arrow(start=[-4,-9,0],end=[1,-8,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow7 = Arrow(start=[-4,-11,0],end=[1,-12,0], color=RED
                       , stroke_width=20, tip_length=1)
        arrow8 = Arrow(start=[-4,-17.5,0],end=[1,-17.5,0], color=RED
                       , stroke_width=20, tip_length=1)
        text9 = Tex(
                    r"$f'\left( x_{0}\right) =0$\text{(极值)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([24,0,0])
        text10 = Tex(
                    r"$f'\left( x_{0}\right) \neq 0$",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([19,-5,0])
        text11 = Tex(
                    r"\text{无初始信息}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([7,-8,0])
        text12 = Tex(
                    r"\text{有初始信息(画草图/琴生不等式)}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([20,-12,0])
        text13 = Tex(
                    r"\text{零点唯一与不唯一等问题}",color=GREEN_C
                   ,tex_template=TexTemplateLibrary.ctex).scale(5.0).move_to([16,-17.5,0])
        self.play(Write(text5),Create(rectangle1))
        self.play(Create(arrow1),Create(arrow2),Create(arrow3))
        self.play(Create(text6),Create(text7),Create(text8))
        self.play(Create(arrow4),Create(arrow5),Create(arrow6),Create(arrow7),Create(arrow8))
        self.play(Create(text9),Create(text10),Create(text11),Create(text12),Create(text13))
        #
        #半透明矩阵扩展
        rectangle2=Rectangle(color=BLUE,fill_opacity=0.5,width=1,height=2.8
                            ,stroke_color=YELLOW,stroke_width=0).move_to([2,20,0])
        self.play(
            rectangle2.animate().stretch(24.0,dim=0)
        )
        self.wait(0.1)
        #框框标记
        rectangle3=Rectangle(color=BLUE,fill_opacity=0.0,width=21,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle3.move_to([-4,-2.5,0])
        rectangle4=Rectangle(color=BLUE,fill_opacity=0.0,width=12,height=5
                            ,stroke_color=BLUE,stroke_width=20)
        rectangle4.move_to([19,-5,0])
        self.play( 
            Create(rectangle3),Create(rectangle4)
        )
        self.wait(0.1)


        self.wait()




